<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="pub/top_list2.jsp"%>
<%
	String sql1 = "select * from member where userid=? and password=?";
	String[] param1 = new String[2];
	param1[0] =request.getParameter("userid"); 
	param1[1] =request.getParameter("password"); 
	List<Map<String, Object>> list = db.queryList(sql1, param1); 
	if (list.size()==0){ 
		String sql = "insert into member(userid,password)values(?,?)";
		String[] param = new String[2];
		param[0] = request.getParameter("userid");
		param[1] = request.getParameter("password");
		db = My.getDb1();
		int rtn = db.executeUpdate(sql, param);

		if (rtn > 0) {
			response.sendRedirect("self.jsp?p=1"); 
		} else if (rtn == 0) {response.sendRedirect("sign.jsp?p=0"); }
	} else{ 
		response.sendRedirect("sign.jsp?p=0"); 
	} 
	
	/* List<Map<String, Object>> list = db.queryList(sql, param);
	String name = request.getParameter("userid"); */
%>